// pages/dealer-service/insurance-report/insurance-report.js
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    btdis: 'none'
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let vin = options.vin;
    let that = this;
    wx.getSystemInfo({
      success: function(res){
        var canvasWidth = res.windowWidth;
        var pageHeight = res.windowHeight;
        that.setData({
          wd: canvasWidth,
          ht: pageHeight
        });
      }
    });
    wx.request({
      url: app.globalData.host + "/getCarInfoByVin/",
      data: {
        vin: vin
      },
      method: "POST",
      header: { "content-type": "application/x-www-form-urlencoded" },
      success: function (res) {
        that.setData({
          brand: res.data.brand,
          cx: res.data.cx,
          vin: vin
        })
        console.log(res.data.brand);
        console.log(res.data.cx);
        console.log(res.data.pl);
      }
    });
  },
  submitOrder: function(){
    let that = this;
    that.setData({
      btdis: 'block'
    })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})